(function(window) {

	var search = location.search;
	var couponId = search.slice(4);

	$.ajax({
		url:'http://127.0.0.1:3000/api/getcouponproduct',
		data:{couponid: couponId},
		success: function(data) {
			console.log(data);
			// var html = template('template1', data);
			// $(".main").html(html);

			//01 获取数据渲染标题
			var couponName = window.localStorage.getItem('couponName')
			var title = couponName + '优惠券';
			$('.moneyctrl_head>div').html(title)

			//02 获取数据渲染列表详细信息
			var html = template('template1', data);
			$('.main').html(html);


			//03 单机显示遮罩层
			$('.list').on('click', function() {
				$('#shade').css('display', 'block')
				// $('.img_shade').html(data.)
				// console.log(this.dataset.img)
				var count = this.dataset.img;
				$('.img_shade').html(data.result[count].couponProductImg)
			})


		}
	})




})(window)